/**
 * @param {number} x
 * @return {boolean}
 */
 var isPalindrome = function(x) {
   let  temp= x
   let res = 0
   let digital
  while(x!=0){
    digital = x%10
    x = ~~(x/10)
    res = res*10 +digital
  }
  return  res == temp && temp>0
};

console.log(isPalindrome(-121));